package com.design.factorypatten;

public class ShapeFactory {
    public Shape getShape(String shpeType){
        if(shpeType == null || "".equals(shpeType)){
            return null;
        }

        if("rectangle".equals(shpeType)){
            return new Rectangle();
        }else if ("circle".equals(shpeType)){
            return new Circle();
        }else if ("square".equals(shpeType)){
            return new Square();
        }

        return null;
    }
}
